import java.util.PriorityQueue;

public class Test {


    public static void main(String[] args) {
        //实例化出了一个堆——>优先级队列
        PriorityQueue<Integer> priorityQueue = new PriorityQueue<>();
        priorityQueue.offer(12);
        priorityQueue.offer(5);
        priorityQueue.offer(57);

        System.out.println(priorityQueue.poll()); //5
        System.out.println(priorityQueue.poll()); //12

    }


    public static void main1(String[] args) {
        TestHeap heap = new TestHeap();
        int[] array = {27,15,19,18,28,34,65,49,25,37};
        heap.init(array);


        heap.creatHeap();

    }
}
